﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;


namespace GiaoDien
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["MaSP"] != null)
            {
                int MaSP = Int32.Parse(Request.QueryString["MaSP"].ToString());
                ServiceKD.ServiceSoapClient proxy = new GiaoDien.ServiceKD.ServiceSoapClient("ServiceSoap");
                ServiceKD.SanPham sp = proxy.layThongTinSanPham(MaSP);
                ServiceKD.SanPham[] dssp = new GiaoDien.ServiceKD.SanPham[1];
                dssp[0] = sp;

                DataList1.DataSource = dssp;
                DataList1.DataBind();
            }
            else
                Response.Redirect("ListSanPham.aspx");
           
        }

        

        protected void lbtnDatMua_Click1(object sender, EventArgs e)
        {
            int MaSP = Int32.Parse(Request.QueryString["MaSP"].ToString());
            int SoLuongMua = Int32.Parse(txtSoLuongMua.Text);
            Response.Redirect("GioHang.aspx?action=add&MaSP=" + MaSP.ToString() + "&SoLuongMua=" + SoLuongMua.ToString());
        }
    }
}
